import Vue from 'vue'
import Vuex from 'vuex'
import { setLocalStorage } from '../common/js/util'
Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    userInfo: '',
    Authorization: ''
  },
  mutations: {
    setUser (state, data) {
      console.log(data)
      setLocalStorage('userInfo', data)
      state.userInfo = data
    },
    setToken (state, data) {
      setLocalStorage('Authorization', data)
      state.Authorization = data
    }
  },
  actions: {
  },
  modules: {
  },
  
})
